struct VSOUT
{
	float4 Position         : POSITION;
	float4 Diffuse			: COLOR;
	float2 TexCoord0		: TEXCOORD0;
	float4 TexCoord1		: TEXCOORD1;
};

uniform float4 g_vScreenResolution;		// x ->width y->height z->0.5/width w->0.5/height 

VSOUT ProcessVertex( VSIN _input )
{
    VSOUT Output = (VSOUT)0;

	Output.Position = mul(_input.Position, g_mWorldViewProj);
	Output.Diffuse = _input.Color0;
	Output.TexCoord0 = _input.TexCoord0;
	
	
	float4 TexCoord = Output.Position.xyzw / Output.Position.w;
	TexCoord.xy = 0.5f * (TexCoord.xy + 1.0f) ;
    TexCoord.y = 1.0 - TexCoord.y;

	TexCoord.xy = TexCoord.xy + g_vScreenResolution.zw;

	Output.TexCoord1 = TexCoord;

	return Output;
}